<template>
  <el-row class="app-breadcrumb" type="flex" justify="center">
    <el-col :span="24">
      <el-breadcrumb separator="/">
        <el-breadcrumb-item v-if="isIndexPath" class="breadcrumb-index">订单</el-breadcrumb-item>
        <el-breadcrumb-item v-if="!isIndexPath" :to="{ path: '/orders' }">订单</el-breadcrumb-item>
        <el-breadcrumb-item v-if="!isIndexPath">订单【{{order.serial_number}}】的详情</el-breadcrumb-item>
      </el-breadcrumb>
    </el-col>
  </el-row>
</template>

<script>
import {mapGetters} from 'vuex'

export default {
  computed: {
    ...mapGetters('orders', [
      'order'
    ]),
    isIndexPath() {
      return this.$route.name === 'orders'
    }
  }
}
</script>
